package edu.sandau.basic.service.impl;

import edu.sandau.basic.domain.MenuLang;
import edu.sandau.basic.mapper.MenuLangMapper;
import edu.sandau.basic.service.MenuLangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class MenuLangServiceImpl implements MenuLangService {

    @Autowired
    private MenuLangMapper menuLangMapper;

    @Override
    public List<MenuLang> getMenuLangsByMenuId(Integer menuId) {
        return menuLangMapper.selectByMenuId(menuId);
    }

    @Override
    @Transactional
    public void addMenuLang(MenuLang lang) {
        menuLangMapper.insert(lang);
    }

    @Override
    @Transactional
    public void updateMenuLang(MenuLang lang) {
        menuLangMapper.update(lang);
    }

    @Override
    @Transactional
    public void deleteMenuLang(Integer id) {
        menuLangMapper.delete(id);
    }
}
